

sample1 <- read.table(file="/home/trflp/data/03-27-10_Devkota-ROX/C04_782.abi", col.names = c("Color", "time", "length", "height", "area", "point"))
sample1.B <- cbind(sample1[grep("^B", as.character(sample1$Color), perl = T), 3], sample1[grep("^B", as.character(sample1$Color), perl = T), 5])
sample1.B <- cbind(sample1.B, sample1.B[,2]/sum(sample1.B[,2]))

sample2 <- read.table(file="/home/trflp/data/03-27-10_Devkota-ROX/G04_751.abi", col.names = c("Color", "time", "length", "height", "area", "point"))
sample2.B <- cbind(sample2[grep("^B", as.character(sample2$Color), perl = T), 3], sample2[grep("^B", as.character(sample2$Color), perl = T), 5])
sample2.B <- cbind(sample2.B, sample2.B[,2]/sum(sample2.B[,2]))

sample3 <- read.table(file="/home/trflp/data/03-27-10_Devkota-ROX/E04_778.abi", col.names = c("Color", "time", "length", "height", "area", "point"))
sample3.B <- cbind(sample3[grep("^B", as.character(sample3$Color), perl = T), 3], sample3[grep("^B", as.character(sample3$Color), perl = T), 5])
sample3.B <- cbind(sample3.B, sample3.B[,2]/sum(sample3.B[,2]))

sample4 <- read.table(file="/home/trflp/data/03-27-10_Devkota-ROX/D04_777.abi", col.names = c("Color", "time", "length", "height", "area", "point"))
sample4.B <- cbind(sample4[grep("^B", as.character(sample4$Color), perl = T), 3], sample4[grep("^B", as.character(sample4$Color), perl = T), 5])
sample4.B <- cbind(sample4.B, sample4.B[,2]/sum(sample4.B[,2]))

sample5 <- read.table(file="/home/trflp/data/03-27-10_Devkota-ROX/H03_784.abi", col.names = c("Color", "time", "length", "height", "area", "point"))
sample5.B <- cbind(sample5[grep("^B", as.character(sample5$Color), perl = T), 3], sample5[grep("^B", as.character(sample5$Color), perl = T), 5])
sample5.B <- cbind(sample5.B, sample5.B[,2]/sum(sample5.B[,2]))

sample6 <- read.table(file="/home/trflp/data/03-27-10_Devkota-ROX/D03_793.abi", col.names = c("Color", "time", "length", "height", "area", "point"))
sample6.B <- cbind(sample6[grep("^B", as.character(sample6$Color), perl = T), 3], sample6[grep("^B", as.character(sample6$Color), perl = T), 5])
sample6.B <- cbind(sample6.B, sample6.B[,2]/sum(sample6.B[,2]))

sample7 <- read.table(file="/home/trflp/data/03-27-10_Devkota-ROX/F03_779.abi", col.names = c("Color", "time", "length", "height", "area", "point"))
sample7.B <- cbind(sample7[grep("^B", as.character(sample7$Color), perl = T), 3], sample7[grep("^B", as.character(sample7$Color), perl = T), 5])
sample7.B <- cbind(sample7.B, sample7.B[,2]/sum(sample7.B[,2]))

sample8 <- read.table(file="/home/trflp/data/03-27-10_Devkota-ROX/A04_792.abi", col.names = c("Color", "time", "length", "height", "area", "point"))
sample8.B <- cbind(sample8[grep("^B", as.character(sample8$Color), perl = T), 3], sample8[grep("^B", as.character(sample8$Color), perl = T), 5])
sample8.B <- cbind(sample8.B, sample8.B[,2]/sum(sample8.B[,2]))

sample9 <- read.table(file="/home/trflp/data/03-27-10_Devkota-ROX/E03_780.abi", col.names = c("Color", "time", "length", "height", "area", "point"))
sample9.B <- cbind(sample9[grep("^B", as.character(sample9$Color), perl = T), 3], sample9[grep("^B", as.character(sample9$Color), perl = T), 5])
sample9.B <- cbind(sample9.B, sample9.B[,2]/sum(sample9.B[,2]))

sample10 <- read.table(file="/home/trflp/data/03-27-10_Devkota-ROX/F04_750.abi", col.names = c("Color", "time", "length", "height", "area", "point"))
sample10.B <- cbind(sample10[grep("^B", as.character(sample10$Color), perl = T), 3], sample10[grep("^B", as.character(sample10$Color), perl = T), 5])
sample10.B <- cbind(sample10.B, sample10.B[,2]/sum(sample10.B[,2]))

sample11 <- read.table(file="/home/trflp/data/03-27-10_Devkota-ROX/B04_781.abi", col.names = c("Color", "time", "length", "height", "area", "point"))
sample11.B <- cbind(sample11[grep("^B", as.character(sample11$Color), perl = T), 3], sample11[grep("^B", as.character(sample11$Color), perl = T), 5])
sample11.B <- cbind(sample11.B, sample11.B[,2]/sum(sample11.B[,2]))

sample12 <- read.table(file="/home/trflp/data/03-27-10_Devkota-ROX/G03_783.abi", col.names = c("Color", "time", "length", "height", "area", "point"))
sample12.B <- cbind(sample12[grep("^B", as.character(sample12$Color), perl = T), 3], sample12[grep("^B", as.character(sample12$Color), perl = T), 5])
sample12.B <- cbind(sample12.B, sample12.B[,2]/sum(sample12.B[,2]))

sample13 <- read.table(file="/home/trflp/data/03-27-10_Devkota-ROX/H04_794.abi", col.names = c("Color", "time", "length", "height", "area", "point"))
sample13.B <- cbind(sample13[grep("^B", as.character(sample13$Color), perl = T), 3], sample13[grep("^B", as.character(sample13$Color), perl = T), 5])
sample13.B <- cbind(sample13.B, sample13.B[,2]/sum(sample13.B[,2]))


B.list <- list(sample1.B, sample2.B, sample3.B, sample4.B, sample5.B, sample6.B, sample7.B, sample8.B, sample9.B, sample10.B, sample11.B, sample12.B, sample13.B)
B.Data <- Gfiltering.ftn(B.list, 2)
B.ClusBin <- GclustBin.ftn(B.Data[[1]], 1)
ClustBin <- rbind(B.ClusBin)
write.table(t(B.ClusBin), file="/home/trflp/web/tmp/ClusBinMatrix.txt", sep="\t", row.names=c("length", "/home/trflp/data/03-27-10_Devkota-ROX/C04_782", "/home/trflp/data/03-27-10_Devkota-ROX/G04_751", "/home/trflp/data/03-27-10_Devkota-ROX/E04_778", "/home/trflp/data/03-27-10_Devkota-ROX/D04_777", "/home/trflp/data/03-27-10_Devkota-ROX/H03_784", "/home/trflp/data/03-27-10_Devkota-ROX/D03_793", "/home/trflp/data/03-27-10_Devkota-ROX/F03_779", "/home/trflp/data/03-27-10_Devkota-ROX/A04_792", "/home/trflp/data/03-27-10_Devkota-ROX/E03_780", "/home/trflp/data/03-27-10_Devkota-ROX/F04_750", "/home/trflp/data/03-27-10_Devkota-ROX/B04_781", "/home/trflp/data/03-27-10_Devkota-ROX/G03_783", "/home/trflp/data/03-27-10_Devkota-ROX/H04_794"), col.names=F)
